#include "ThreadGuard.h"

HTHREADPOOL_NAMESPACE_BEGIN
    ThreadGuard::ThreadGuard(std::thread & _t)
    : t(_t)
    {
    }

    ThreadGuard::~ThreadGuard()
    {
        if(t.joinable()) {
            t.join();  // 在析构函数中加入线程
        }
    }

HTHREADPOOL_NAMESPACE_END
